package com.atguigu.springcloud.OrderMain80.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: 王丹
 * @Date: 2021/2/27 0027 35
 * @Description:
 */
@Configuration
public class ApplicationContextConfig {

    @Bean//类似于application.xml <bean id = ''>...
    //@LoadBalanced//该注解能使RestTemplate开启负载均衡能力，没有该注解报错 java.net.UnknownHostException: CLOUD-PAYMENT-SERVICE  22_支付微服务集群配置 17'
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

}
